package com.leemon.mall.admin.security;

import com.leemon.mall.common.util.Json;
import com.leemon.mall.security.token.AuthenticationTokenParser;
import org.springframework.security.authentication.AbstractAuthenticationToken;
import org.springframework.stereotype.Component;

/**
 * @author limenglong
 * @create 2019-09-16 13:56
 * @desc
 **/
@Component
public class AdminAuthenticationTokenParser implements AuthenticationTokenParser {
    @Override
    public AbstractAuthenticationToken parse(String authenticationTokenStr) {
        AdminAuthenticationToken token = Json.parseObject(authenticationTokenStr,AdminAuthenticationToken.class);
        return token;
    }
}
